<template>
  <a-tabs v-model:activeKey="activeKey" @change="handleTabChange">
    <a-tab-pane key="1" tab="Excel"></a-tab-pane>
    <a-tab-pane key="2" tab="数据库" force-render></a-tab-pane>
  </a-tabs>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";

export default defineComponent({
  name: "SwitchTab",
  emits: ["update:activeKey"],
  setup(props, { emit }) {
    const activeKey = ref("1");

    const handleTabChange = (key: string) => {
      activeKey.value = key; // 更新activeKey的值
      emit("update:activeKey", key);
    };

    return {
      activeKey,
      handleTabChange,
    };
  },
});
</script>

<style scoped></style>
